﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo02
{
    class Program
    {
        static void Main(string[] args)
        {
            shape();
            jisuan();
        }
        static void jisuan()
        {
            Console.WriteLine("请输入第一个数：");
            int a = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入第二个数：");
            int b = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入+、-、*、/中的任意一个");
            string c = Console.ReadLine();
            switch (c)
            {
                case "+":
                    jiafa jia = new jiafa();
                    jia.protected1 = a;
                    jia.protected2 = b;
                    jia.DisplayResult();
                    break;
                case "-":
                    jianfa jian = new jianfa();
                    jian.protected1 = a;
                    jian.protected2 = b;
                    jian.DisplayResult();
                    break;
                case "*":
                    chengfa cheng = new chengfa();
                    cheng.protected1 = a;
                    cheng.protected2 = b;
                    cheng.DisplayResult();
                    break;
                case "/":
                    chufa chu = new chufa();
                    chu.protected1 = a;
                    chu.protected2 = b;
                    chu.DisplayResult();
                    break;
                default:
                    break;

            }
        }
        static void shape()
        {
            Console.WriteLine("请选择要计算面积的图形： 1、圆形 2、正方形");
            int a = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入图形颜色：");
            string b = Console.ReadLine();
            switch (a)
            {
                case 1:
                    Circle c = new Circle();
                    Console.WriteLine("请输入圆的半径：");
                    int radius = int.Parse(Console.ReadLine());
                    c.radius = radius;
                    c.GetArea();
                    break;
                case 2:
                    Square s = new Square();
                    Console.WriteLine("请输入正方形的半径：");
                    int sideLen = int.Parse(Console.ReadLine());
                    s.sideLen = sideLen;
                    s.GetArea();
                    break;
                default:
                    break;
            }
        }
    }
}
